<%@ page language="java" pageEncoding="UTF-8"
	contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ include file="/WEB-INF/jsp/include.jsp"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>

<body>
	所有用户都可以访问！！！
	<sec:authentication property="name" />
	<sec:authentication property="authorities" var="authorities"
		scope="page" />
	<c:forEach items="${authorities}" var="authority">
		${authority.authority}
	</c:forEach>

	<c:url var="action" value="/staff/findByName.html" />
	<sec:authorize ifAnyGranted="ROLE_TUTOR">
		<a href="../staff/saveOrUpdate.html">添加校内员工</a>
	</sec:authorize>
	<form action="${action}" method="post">
		<h3>查询校内员工信息</h3>
		<table width="400px" bordercolor='black' border='0'
			style="border-collapse: collapse">
			<tr>
				<td>校内员工姓名：</td>
				<td><input type="text" name="name"></td>
				<td><input type="submit" value="查询"></td>
			</tr>
			<tr>
				
			</tr>
		</table>
	</form>

	<table width="800px" bordercolor='black' border='1'
		style="border-collapse: collapse">
		<tr>
			<td>ID</td>
			<td>编号</td>
			<td>描述</td>
			
			<sec:authorize ifAnyGranted="ROLE_SCHOOL">
				<td colspan="2">操作</td>
			</sec:authorize>
		</tr>
		<c:forEach items="${staffList}" var="staff" varStatus="i">
			<tr>
				<td>${staff.id}</td>
				<td>${staff.name}</td>
				<td>${staff.no}</td>				
				<sec:authorize ifAnyGranted="ROLE_SCHOOL">
					<td><a
						href="../staff/findById/${staff.id}.html?pageNo=${pageNo}">修改</a></td>
					<td><a
						href="../staff/delete/${staff.id}.html?pageNo=${pageNo}">删除</a></td>
				</sec:authorize>
			</tr>
		</c:forEach>
	</table>
	<totoro:PageBar pageUrl="/staff/list.html" pageAttrKey="pagedPost" />
	<p>
		<a href="<c:url value="../j_spring_security_logout"/>">Logoff</a>
		(also clears any remember-me cookie)
</body>
</html>